using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Domain.Model;

namespace Domain
{
public class KnownTypes
{
    public static IEnumerable<Type> GetKnownTypes(ICustomAttributeProvider provider)
    {
        var types = new List<Type>();
        List<Type> list =
            Assembly.GetAssembly(typeof(Product)).GetTypes().Where(a => a.Namespace == "Domain.Model").
                ToList();
        list.Add(typeof(int));
        list.Add(typeof(string));
        list.ForEach(type =>
        {
            types.Add(type);
            if (!type.IsGenericType)
                types.Add(type.MakeArrayType());
        });


        return types;
    }
}
}